package es.usj.tac.meteorologica.dto;

import java.io.Serializable;

/**
 * Clase de almacenamiento de datos de un objeto City
 * 
 *
 */
public class City implements Serializable {

    private int id;
    private String name;
    private int poblation;

    public City() {
    }

    public City(String name, int poblation){
    	super();
    	this.name=name;
    	this.poblation=poblation;
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPoblation() {
        return poblation;
    }

    public void setPoblation(int poblation) {
        this.poblation = poblation;
    }

    public boolean equals(Object inObject) {
        if(inObject == null) return false;

        if(!(inObject instanceof City)) return false;

        City obj = (City) inObject;
        if(id != obj.id)
            return false;
        if(!name.equals(obj.name))
            return false;
        if(poblation != (obj.poblation))
            return false;
        return true;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer("City::");
        sb.append("id=");
        sb.append(id);
        sb.append(";name=");
        sb.append(name);
        sb.append(";poblation=");
        sb.append(poblation);
        return sb.toString();
    }

}
